package tank;

import java.io.IOException;
import java.util.Properties;

/**
 * @Auther: fei
 * @Date: 2021/6/17 - 06 - 17 - 19:05
 * @Description: tank
 * @version: 1.0
 */
public class PropertyMgr {
    static Properties props = new Properties();
    static{
        try {
            props.load(PropertyMgr.class.getClassLoader().getResourceAsStream("config.properties"));
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    public static Object get(String key){
        if (props == null) return null;
        return props.get(key);
    }

    //这是一个main方法，是程序的入口：
    public static void main(String[] args) {
        System.out.println(PropertyMgr.get("initTankCount"));
    }
}
